import {getState, upDateStateJwtKey} from '../localStorages/localStorageUesrData.js';

// 初始化用户信息
async function InitInformation() {
    // 更新本地存储
    let userData = (await  upDateStateJwtKey()).count;
    console.log("更新本地存储" ,userData)
    document.getElementById('username').innerText = userData.username;
    document.getElementById('email').innerText = `邮箱: ${userData.email}`;
    document.getElementById('introduction').innerText = `简介: ${userData.introduction || "这个人没有写简介"}`;
    document.getElementById('avatar').src = userData.image === "default-avatar" ?
        './img/default-avatar.jpg' : userData.image;
}


export {
    InitInformation
}